import { ref } from 'vue'
import useStorage from '@renderer/composables/useStorage'
export default () => {
  const roomFormItem = ref<RoomItemModel[]>()
  const backGroundFormItem = ref<collectionItemModel[]>()
  const carpenterFormItem = ref<collectionItemModel[]>()
  const wardrobeFormItem = ref<WardrobeItemModel[]>()
  const lineFormItem = ref<collectionItemModel[]>()
  const waterproofFormItem = ref<collectionItemModel[]>()
  const otherFormItem = ref<collectionItemModel[]>()
  const tearFormItem = ref<collectionItemModel[]>()
  const cabinetFormItem = ref<collectionItemModel[]>()
  const storage = useStorage()
  const handleRoomFromItem = (roomName: string) => {
    roomFormItem.value = [
      {
        label: '贴砖厚',
        key: 'thick_bricks',
        type: 1,
        unit: '米',
        isShow: true,
        required: true,
      },
      {
        label: '房间长',
        key: 'long_room',
        type: 1,
        unit: '米',
        isShow: true,
        required: true,
      },
      {
        label: '房间宽',
        key: 'width_room',
        type: 1,
        unit: '米',
        isShow: true,
        required: true,
      },
      {
        label: '门口宽',
        key: 'width_doorway',
        type: 1,
        unit: '米',
        isShow: Boolean(
          roomName != '过道' &&
            roomName != '主卧过道' &&
            roomName != '次卧1过道' &&
            roomName != '次卧2过道' &&
            roomName != '阳台1' &&
            roomName != '阳台2' &&
            roomName != '阳台3' &&
            roomName != '阳台4',
        ),
        required: Boolean(roomName != '客厅' && roomName != '餐厅' && roomName != '过道'),
      },
      {
        label: '窗宽',
        key: 'width_window',
        type: 1,
        unit: '米',
        isShow: true,
        required: Boolean(
          roomName != '洗手间' &&
            roomName != '过道' &&
            roomName != '主卧过道' &&
            roomName != '次卧1过道' &&
            roomName != '次卧2过道' &&
            roomName != '客厅' &&
            roomName != '餐厅' &&
            roomName != '衣帽间' &&
            roomName != '窗高',
        ),
      },
      {
        label: '门口1宽',
        key: 'width_doorway',
        type: 1,
        unit: '米',
        isShow: Boolean(roomName == '阳台1' || roomName == '阳台2' || roomName == '阳台3' || roomName == '阳台4'),
        required: true,
      },
      {
        label: '门口1推拉门',
        key: 'doorway_door1',
        type: 2,
        unit: '',
        options: ['有', '无'],
        isShow: Boolean(roomName == '阳台1' || roomName == '阳台2' || roomName == '阳台3' || roomName == '阳台4'),
        required: true,
      },
      {
        label: '窗高',
        key: 'height_window',
        type: 1,
        unit: '米',
        isShow: true,
        required: Boolean(
          roomName != '洗手间' &&
            roomName != '过道' &&
            roomName != '主卧过道' &&
            roomName != '次卧1过道' &&
            roomName != '次卧2过道' &&
            roomName != '客厅' &&
            roomName != '餐厅' &&
            roomName != '衣帽间' &&
            roomName != '窗高',
        ),
      },
      {
        label: '门口2宽',
        key: 'width_doorway2',
        type: 1,
        unit: '米',
        isShow: Boolean(roomName == '阳台1' || roomName == '阳台2' || roomName == '阳台3' || roomName == '阳台4'),
        required: false,
      },
      {
        label: '门口2推拉门',
        key: 'doorway_door2',
        type: 2,
        unit: '',
        options: ['有', '无'],
        isShow: Boolean(roomName == '阳台1' || roomName == '阳台2' || roomName == '阳台3' || roomName == '阳台4'),
        required: false,
      },

      {
        label: '洞口宽',
        key: 'width_open',
        type: 1,
        unit: '米',
        isShow: Boolean(roomName == '客厅' || roomName == '过道' || roomName == '餐厅'),
        required: true,
      },
      {
        label: '飘窗',
        key: 'bay_window',
        type: 2,
        unit: '',
        isShow: Boolean(
          roomName == '客厅' ||
            roomName == '餐厅' ||
            roomName == '主卧' ||
            roomName == '次卧1' ||
            roomName == '次卧2' ||
            roomName == '次卧3' ||
            roomName == '次卧4' ||
            roomName == '衣帽间' ||
            roomName == '楼梯间',
        ),
        required: true,
      },
      {
        label: '是否贴墙砖',
        key: 'wall_tiling',
        type: 2,
        unit: '',
        isShow: Boolean(roomName == '阳台1' || roomName == '阳台2' || roomName == '阳台3' || roomName == '阳台4'),
        required: true,
      },
      {
        label: '窗帘盒',
        key: 'curtain_box',
        type: 2,
        unit: '',
        isShow: Boolean(
          roomName == '客厅' ||
            roomName == '餐厅' ||
            roomName == '主卧' ||
            roomName == '次卧1' ||
            roomName == '次卧2' ||
            roomName == '次卧3' ||
            roomName == '次卧4' ||
            roomName == '阳台1' ||
            roomName == '阳台2' ||
            roomName == '阳台3' ||
            roomName == '阳台4' ||
            roomName == '衣帽间',
        ),
        required: true,
        options: ['有', '无'],
      },
      {
        label: '木地板',
        key: 'wood_floor',
        type: 2,
        unit: '',
        isShow: Boolean(
          roomName == '客厅' ||
            roomName == '餐厅' ||
            roomName == '过道' ||
            roomName == '主卧' ||
            roomName == '主卧过道' ||
            roomName == '次卧1' ||
            roomName == '次卧2' ||
            roomName == '次卧3' ||
            roomName == '次卧4' ||
            roomName == '次卧1过道' ||
            roomName == '次卧2过道' ||
            roomName == '衣帽间' ||
            roomName == '阳台1' ||
            roomName == '阳台2' ||
            roomName == '阳台3' ||
            roomName == '阳台4' ||
            roomName == '楼梯间',
        ),
        required: true,
      },
      {
        label: '吊顶',
        key: 'top',
        type: 2,
        unit: '',
        isShow: true,
        required: true,
        options: ['有', '无'],
      },
      {
        label: '边吊类型',
        key: 'side_type',
        type: 4,
        unit: '项',
        isShow: Boolean(
          roomName == '客厅' ||
            roomName == '餐厅' ||
            roomName == '过道' ||
            roomName == '次卧1' ||
            roomName == '次卧2' ||
            roomName == '次卧3' ||
            roomName == '次卧4' ||
            roomName == '主卧',
        ),
        required: true,
      },
      {
        label: '顶展宽',
        key: 'top_width',
        type: 1,
        unit: '米',
        isShow: Boolean(
          roomName == '客厅' ||
            roomName == '餐厅' ||
            roomName == '过道' ||
            roomName == '次卧1' ||
            roomName == '次卧2' ||
            roomName == '次卧3' ||
            roomName == '次卧4' ||
            roomName == '主卧',
        ),
        required: true,
      },
      {
        label: '无主灯吊顶',
        key: 'main_light',
        type: 2,
        unit: '项',
        isShow: Boolean(
          roomName == '客厅' ||
            roomName == '餐厅' ||
            roomName == '过道' ||
            roomName == '次卧1' ||
            roomName == '次卧2' ||
            roomName == '次卧3' ||
            roomName == '次卧4' ||
            roomName == '主卧',
        ),
        required: true,
      },
      {
        label: '吊顶面积',
        key: 'total_square',
        type: 1,
        unit: '平方',
        isShow: Boolean(
          roomName == '客厅' ||
            roomName == '餐厅' ||
            roomName == '过道' ||
            roomName == '次卧1' ||
            roomName == '次卧2' ||
            roomName == '次卧3' ||
            roomName == '次卧4' ||
            roomName == '主卧过道' ||
            roomName == '主卧' ||
            roomName == '阳台1' ||
            roomName == '阳台2' ||
            roomName == '阳台3' ||
            roomName == '阳台4' ||
            roomName == '楼梯间' ||
            roomName == '次卧1过道' ||
            roomName == '次卧2过道' ||
            roomName == '衣帽间' ||
            roomName == '厨房' ||
            roomName == '客卫' ||
            roomName == '洗手间' ||
            roomName == '主卫' ||
            roomName == '次卫',
        ),
        required: true,
      },

      {
        label: '楼梯扶手',
        key: 'stair_handrail',
        type: 1,
        unit: '米',
        isShow: Boolean(roomName == '楼梯间'),
        required: true,
      },
      {
        label: '楼梯踏步',
        key: 'stair_tread',
        type: 1,
        unit: '阶',
        isShow: Boolean(roomName == '楼梯间'),
        required: true,
      },
      {
        label: '踏步类型',
        key: 'stair_type',
        type: 3,
        unit: '',
        isShow: Boolean(roomName == '楼梯间'),
        required: true,
      },
    ]
  }
  const handleBackGroundFromItem = (calculate_id: number, house_number: number) => {
    backGroundFormItem.value = [
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '石膏板造型',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景木板基层',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '瓷砖背景',
        number: 0,
        option: 0,
        unit: '项',
        type: 2,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景瓷砖',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景瓷砖地台',
        number: '0',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景石材',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景石材地台',
        number: '0',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景木饰面',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景木格栅',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景壁布',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景壁画',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景软包',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景硬包',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景中式花格',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景文化石',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景玻璃/镜子',
        number: '0',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '背景墙项目',
        name: '背景墙石膏线',
        number: '0',
        option: 0,
        unit: '米',
        type: 1,
      },
    ]
  }
  const handleCarpenterFormItem = (calculate_id: number, house_number: number) => {
    carpenterFormItem.value = [
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '窗帘盒长',
        number: '0',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '封门口宽',
        number: '0',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '单钉垛',
        number: '0',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '封衣柜口',
        number: '0',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '封衣柜侧板',
        number: '0',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '石膏板立管',
        number: '0',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '石膏板封横管',
        number: '0',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '门口找平',
        number: 0,
        option: 0,
        unit: '项',
        type: 2,
      },
      {
        calculate_id,
        house_number,
        cate_name: '木作项目',
        name: '窗口找平',
        number: 0,
        option: 0,
        unit: '项',
        type: 2,
      },
    ]
  }
  const handleWardrobeFormItem = (roomName: string, calculate_id: number, house_number: number) => {
    const wardrobeItemList: WardrobeModel[] = [
      {
        name: '客厅',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '客厅',
            cate_name: '厚60cm柜体',
            name: '客厅储藏柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '客厅',
            cate_name: '厚35cm柜体',
            name: '客厅书柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '客厅',
            cate_name: '高80cm以内',
            name: '客厅电视柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '餐厅',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '餐厅',
            cate_name: '厚60cm柜体',
            name: '餐厅储藏柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '餐厅',
            cate_name: '厚35cm柜体',
            name: '餐厅酒柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '餐厅',
            cate_name: '高80cm以内',
            name: '餐厅吧台',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '过道',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '过道',
            cate_name: '厚60cm柜体',
            name: '走廊储藏柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '过道',
            cate_name: '厚35cm柜体',
            name: '走廊鞋柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '主卧',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '主卧',
            cate_name: '厚60cm柜体',
            name: '主卧衣柜1',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '主卧',
            cate_name: '厚60cm柜体',
            name: '主卧衣柜2',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '主卧',
            cate_name: '厚35cm柜体',
            name: '主卧书柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '主卧',
            cate_name: '高80cm以内',
            name: '主卧书桌',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '主卧',
            cate_name: '高80cm以内',
            name: '主卧飘窗柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '次卧1',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '次卧1',
            cate_name: '厚60cm柜体',
            name: '次卧1衣柜1',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧1',
            cate_name: '厚60cm柜体',
            name: '次卧1衣柜2',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧1',
            cate_name: '厚35cm柜体',
            name: '次卧1书柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧1',
            cate_name: '高80cm以内',
            name: '次卧1书桌',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧1',
            cate_name: '高80cm以内',
            name: '次卧1飘窗柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '次卧2',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '次卧2',
            cate_name: '厚60cm柜体',
            name: '次卧2衣柜1',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧2',
            cate_name: '厚60cm柜体',
            name: '次卧2衣柜2',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧2',
            cate_name: '厚35cm柜体',
            name: '次卧2书柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧2',
            cate_name: '高80cm以内',
            name: '次卧2书桌',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧2',
            cate_name: '高80cm以内',
            name: '次卧2飘窗柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '次卧3',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '次卧3',
            cate_name: '厚60cm柜体',
            name: '次卧3衣柜1',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧3',
            cate_name: '厚60cm柜体',
            name: '次卧3衣柜2',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧3',
            cate_name: '厚35cm柜体',
            name: '次卧3书柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧3',
            cate_name: '高80cm以内',
            name: '次卧3书桌',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧3',
            cate_name: '高80cm以内',
            name: '次卧3飘窗柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '次卧4',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '次卧4',
            cate_name: '厚60cm柜体',
            name: '次卧4衣柜1',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧4',
            cate_name: '厚60cm柜体',
            name: '次卧4衣柜2',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧4',
            cate_name: '厚35cm柜体',
            name: '次卧4书柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧4',
            cate_name: '高80cm以内',
            name: '次卧4书桌',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '次卧4',
            cate_name: '高80cm以内',
            name: '次卧4飘窗柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '厨房',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '厨房',
            cate_name: '厚60cm柜体',
            name: '厨房冰箱柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '厨房',
            cate_name: '高80cm以内',
            name: '厨房地柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '厨房',
            cate_name: '高80cm以内',
            name: '厨房吊柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '阳台1',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '阳台1',
            cate_name: '厚60cm柜体',
            name: '阳台1储藏柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '阳台1',
            cate_name: '厚35cm柜体',
            name: '阳台1鞋柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '阳台1',
            cate_name: '高80cm以内',
            name: '阳台1洗衣地柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '阳台1',
            cate_name: '高80cm以内',
            name: '阳台1洗衣吊柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '阳台2',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '阳台2',
            cate_name: '厚60cm柜体',
            name: '阳台2储藏柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '阳台2',
            cate_name: '厚35cm柜体',
            name: '阳台2鞋柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '阳台3',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '阳台3',
            cate_name: '厚60cm柜体',
            name: '阳台3储藏柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '阳台3',
            cate_name: '厚35cm柜体',
            name: '阳台3鞋柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '阳台4',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '阳台4',
            cate_name: '厚60cm柜体',
            name: '阳台4储藏柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '阳台4',
            cate_name: '厚35cm柜体',
            name: '阳台4鞋柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '衣帽间',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '衣帽间',
            cate_name: '厚60cm柜体',
            name: '衣帽间衣柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '衣帽间',
            cate_name: '厚35cm柜体',
            name: '衣帽间鞋柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '衣帽间',
            cate_name: '高80cm以内',
            name: '衣帽间梳妆台/书桌',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
      {
        name: '楼梯间',
        writeInfo: [
          {
            calculate_id,
            house_number,
            area_name: '楼梯间',
            cate_name: '厚60cm柜体',
            name: '楼梯间储藏柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '楼梯间',
            cate_name: '厚35cm柜体',
            name: '楼梯间鞋柜',
            width: '0',
            height: '0',
            long: '0',
          },
          {
            calculate_id,
            house_number,
            area_name: '楼梯间',
            cate_name: '厚35cm柜体',
            name: '楼梯间书柜',
            width: '0',
            height: '0',
            long: '0',
          },
        ],
      },
    ]
    wardrobeFormItem.value = wardrobeItemList.find((wardrobeItem) => wardrobeItem.name === roomName)!.writeInfo
  }
  const handleLineFormItem = (calculate_id: number, house_number: number) => {
    lineFormItem.value = [
      {
        calculate_id,
        house_number,
        cate_name: '线条类',
        name: '双眼皮总宽',
        value: '0.6',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '线条类',
        name: '客餐厅走廊线条',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        options: ['有', '无'],
      },
      {
        calculate_id,
        house_number,
        cate_name: '线条类',
        name: '双眼皮/石膏线',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        options: ['石膏线', '双眼皮'],
      },
      {
        calculate_id,
        house_number,
        cate_name: '线条类',
        name: '双眼皮木方基架',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        options: ['有', '无'],
      },
      {
        calculate_id,
        house_number,
        cate_name: '线条类',
        name: '石膏线几圈',
        value: '1',
        number: '',
        option: 0,
        unit: '圈',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '线条类',
        name: '全房合金线条',
        value: '0',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
    ]
  }
  const handleWaterproofFormItem = (calculate_id: number, house_number: number) => {
    waterproofFormItem.value = [
      {
        calculate_id,
        house_number,
        cate_name: '防水类',
        name: '淋浴区防水高度',
        value: '1.8',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '防水类',
        name: '卫生间防水高度',
        value: '0',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '防水类',
        name: '厨房防水高度',
        value: '0',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '防水类',
        name: '阳台防水高度',
        value: '0',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '防水类',
        name: '阳台满刷防水',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
      },
    ]
  }
  const handleOtherFormItem = async (calculate_id: number, house_number: number) => {
    const calcalateHouseNumber = await storage.get('calcalateHouseNumber')
    otherFormItem.value = [
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '房间高度',
        value: '2.8',
        option: 0,
        unit: '米',
        type: 1,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '贴墙砖高度',
        value: '2.6',
        option: 0,
        unit: '米',
        type: 1,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '门套高度',
        value: '2.4',
        option: 0,
        unit: '米',
        type: 1,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '客厅是否挑空',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: Boolean(calcalateHouseNumber != 1),
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '餐厅是否挑空',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: Boolean(calcalateHouseNumber != 1),
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '贴砖立管',
        value: '4',
        option: 0,
        unit: '根',
        type: 1,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '立管隔音棉',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '浴房隔断',
        value: 0,
        option: 0,
        unit: '个',
        type: 1,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '中央空调',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '阳台洗衣机',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '空调打孔',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '双层石膏板吊顶',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '欧松板基层吊顶',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '吊顶基架工艺',
        value: '钢木结合工艺',
        option: 0,
        unit: '项',
        type: 3,
        options: ['木方工艺', '钢木结合工艺', '纯轻钢工艺'],
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '水路走顶工艺',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '电路一点一定工艺',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '墙漆工艺',
        value: '全房边口顺平工艺',
        option: 0,
        unit: '项',
        type: 3,
        options: ['全房普平工艺', '全房边口顺平工艺', '全房冲筋找平工艺'],
        isShow: true,
      },
      {
        calculate_id,
        house_number,
        cate_name: '其他类',
        name: '全墙挂网',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        isShow: true,
      },
    ]
  }
  const handleTearFormItem = (calculate_id: number, house_number: number) => {
    tearFormItem.value = [
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '铲顶',
        value: 1,
        option: 0,
        unit: '项',
        type: 2,
        options: ['有', '无'],
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '铲墙',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        options: ['有', '无'],
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '120mm砸墙',
        value: '0',
        number: '',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '240mm砸墙',
        value: '0',
        number: '',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '120mm砌墙',
        value: '0',
        number: '',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '240mm砌墙',
        value: '0',
        number: '',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '拆保温墙',
        value: '0',
        number: '',
        option: 0,
        unit: '间',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '拆推拉门',
        value: '0',
        number: '',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '拆飘窗台',
        value: '0',
        number: '',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '砸门垛',
        value: '0',
        number: '',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '提门口',
        value: '0',
        number: '',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '拆砌改类',
        name: '拆地梁',
        value: '0',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
    ]
  }
  const handleCabinetFormItem = (calculate_id: number, house_number: number) => {
    cabinetFormItem.value = [
      {
        calculate_id,
        house_number,
        cate_name: '柜子类',
        name: '定制洗面台',
        value: 0,
        option: 0,
        unit: '项',
        type: 2,
        options: ['石材', '岩板'],
      },
      {
        calculate_id,
        house_number,
        cate_name: '柜子类',
        name: '定制洗面台柜体',
        value: '0',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '柜子类',
        name: '定制洗面台镜柜',
        value: '0',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '柜子类',
        name: '极简玻璃门',
        value: '0',
        number: '',
        option: 0,
        unit: '平方',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '柜子类',
        name: '拉手',
        value: '0',
        number: '',
        option: 0,
        unit: '个',
        type: 1,
      },
      {
        calculate_id,
        house_number,
        cate_name: '柜子类',
        name: '柜子灯带',
        value: '0',
        number: '',
        option: 0,
        unit: '米',
        type: 1,
      },
    ]
  }
  return {
    roomFormItem,
    handleRoomFromItem,
    backGroundFormItem,
    handleBackGroundFromItem,
    carpenterFormItem,
    handleCarpenterFormItem,
    wardrobeFormItem,
    handleWardrobeFormItem,
    lineFormItem,
    handleLineFormItem,
    waterproofFormItem,
    handleWaterproofFormItem,
    otherFormItem,
    handleOtherFormItem,
    tearFormItem,
    handleTearFormItem,
    cabinetFormItem,
    handleCabinetFormItem,
  }
}
